<script type="text/javascript">
	$(document).ready(function() {
		
		$(document).on('click', '#BtnSearch', function() {
			$('#functionType').val("search");
		});
		$(document).on('click', '#BtnTransfer', function() {
			$('#functionType').val("transfer");
		});
	});
	$(window).load(function(){
		var createTaskResult=$("#createTaskResult").val();
		if ($("#form-filter").length>0){
			initTransferButton();
			if (createTaskResult=="true"){
				message = "Your task is created successfully" ;
				generate('success', message);
			}
			else if (createTaskResult=="false"){
				message = "This task is already exists" ;
				generate('error', message);
			}
			else if(createTaskResult == "alreadySubscribed"){
				message = "You had already subscribed this flight !";
				generate('error', message);
			}
			else if(createTaskResult == "notSubscribed"){
				message = "You subscribed this flight successfully !";
				generate('success', message);
			}
		}
	});
	function showTransferToolTip(){
		$('#transfer').attr( "title", "Create task quickly with search criteria" );
	}
</script>